@extends('layouts.tankuang')

@section('content')
    <div id="faren">
       <!--  <a class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="add_zxup()">上传文件</a> -->
        <a class="easyui-linkbutton" iconCls="icon-edit" plain="true"  onclick="edit_zxup()">查看更改</a>

    </div>
    <table id="faren_form" title="" class="easyui-datagrid" style="width:100%;height:600px"
           data-options="rownumbers:true,singleSelect:true,pagination:true,pageSize:20,url:'{{url('admin/xz/xzup',$id)}}',method:'get',toolbar:'#faren'">
        <thead>
        <tr>
            <th data-options="field:'name'" width="70%" >档案名称</th>

            <th data-options="field:'查看更改'" width="30%" formatter="formatAction">操作</th>
        </tr>
        </thead>
    </table>

    <script type="text/javascript">

        function formatAction(value,row,index){
            return '<a class="easyui-linkbutton" iconCls="icon-edit" plain="true"  onclick="edit_zxup()">查看更改</a>';
        }

    </script>

    <div id="tk" class="easyui-window" closed="true" title="新增" data-options="iconCls:'icon-save'"></div>

 
    <script src="{{ URL::asset('/') }}js/weizhi.js"></script>
    <script type="text/javascript">
        
        function add_zxup(){
        	var shuz = fb1();
            var row = $('#faren_form').datagrid('getSelected');
            if (row) {
                var url = 'add_zxup/'+row.up_id+'/other/'+{{$id}};
                $('#tk').window({
                    title: "添加",
                    href: url,
                    width:shuz[0],
					height:shuz[1],
					minimizable:false,
	                top:shuz[2],
	                left:shuz[3],
                    modal:false,
                    closed: false,
                });
            } else {
                $.messager.alert('提示','请选中要上传的档案！');
            }
        }

        function edit_zxup(){
                var shuz = fb1();
                var row = $('#faren_form').datagrid('getSelected');
                if (row) {
                    var url = "{{url('admin/xz/edit_zxup')}}"+"/"+row.up_id+'/other/'+"{{$id}}";

                    $('#tk').window({
                        title: "查看新增",
                        href: url,
                        width:shuz[0],
                        height:shuz[1],
                        minimizable:false,
                        top:shuz[2],
                        left:shuz[3],
                        modal:false,
                        closed: false,
                    });
                }
            }

        

    </script>

    <script type="text/javascript">
        
        

        $("#faren_form").datagrid({

            onDblClickRow: function (index,row) {
                   var row = $('#faren_form').datagrid('getSelected');
					var shuz = fb1();
                    if (row) {
                    var url = 'edit_zxup/'+row.up_id+'/other/'+"{{$id}}";
                    $('#tk').window({
                        title: "查看新增",
                        href: url,
                        width:shuz[0],
						height:shuz[1],
						minimizable:false,
		                top:shuz[2],
		                left:shuz[3],
                        modal:false,
                        closed: false,
                    });
                }

            }
        });






    </script>
@stop

